package day_05;

/**
 * @ClassName Day05Homework_6
 * @Description TODO
 * @Author hp
 * @Date 2021/6/7 15:19
 * @Version 1.0
 **/
public class Day05Homework_6 {
    public static void main(String[] args) {
        int[] nums = new int[]{1, 2, 3, 4, 3, 2, 1};
        int[] nums1 = new int[]{1, 2, 3, 4, 5, 2, 1};
        balaceArrays(nums);
        balaceArrays(nums1);

    }

    public static void balaceArrays(int[] nums) {
        boolean flag = true;
        for (int i = 0; i < nums.length / 2; i++) {
            if (nums[i] != nums[nums.length - (i + 1)]) {
                flag = false;
            }
        }
        for (int num : nums) {
            System.out.print(num+"\t");
        }
        System.out.println("是否对称:\t" + flag);

    }

}
